const path = require('path');
const resolve = (dir) => path.join(__dirname, '.', dir);
module.exports = {
    publicPath: './',
    lintOnSave: false,
    // open: env.VITE_OPEN,
    devServer: {
        port: 8080,
        host: '0.0.0.0',
        proxy: {
          // 本地代理
          // '/api': {
          //   target: 'http://127.0.0.1:80',
          //   changeOrigin: true,
          //   pathRewrite: {
          //     '^/api': ''
          //   }
          // },
          '/api': {
            target: 'http://139.196.220.236:8081',
            changeOrigin: true,
            pathRewrite: {
              '^/api': ''
            }
          },
        }
      },
    chainWebpack: (config) => {
        config.resolve.alias
            .set('@', resolve('src'))
    },
    css: {
        loaderOptions: {
            less: {
                javascriptEnabled: true
            }
        }
    }
}